package com.yumeko.mapper;


import java.net.URI;
import java.util.HashMap;
import java.util.Map;

/**
 * @program: myTomcat_zhenghao
 * @description: 存储静态 和 动态 map
 * @author: Zheng Hao
 * @create: 2020-02-15 11:09
 */
public final class Mapper {
    //存放静态html相关信息
    public Map<String, URI> mapUri = new HashMap<>();

    //存放web.xml相关信息
    public Map<String, HttpServlet> servletMap = new HashMap<String, HttpServlet>();


    public void insertStaticMapper(String uri, URI fileUri) {
        mapUri.put(uri, fileUri);
        mapUri.forEach((key, value) -> {
            System.out.println("静态地址:" + key + "," + "静态绝对路径:" + value);
        });
    }

    public void insertDynamicMapper(String urlPattern, HttpServlet httpServlet) {
        servletMap.put(urlPattern, httpServlet);
        servletMap.forEach((key, value) -> {
            System.out.println("动态地址:" + key + "," + "动态绝对路径:" + value);
        });
    }
}
